
	import java.awt.Rectangle;
	import java.awt.event.ActionEvent;
	import java.awt.event.ActionListener;

	import javax.swing.JButton;
	import javax.swing.JFrame;
	import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * This class is the data UI
 */
	public class DataUI  extends JPanel {
		/**
		 * title for the current window  
		 */
		private JLabel lbltitle = null;
		/**
		 * get data button 
		 */
		private JButton btnGetData;
		/**
		 * handle hexception button
		 */
		private JButton btnHandleEx;
		/**
		 * back button 
		 */
		public JButton btnBack = null;
		/**
		 * help button 
		 */
		public JButton btnHelp = null;
		/**
		 * save the current panel for the "back" function 
		 */
		private JPanel curPanel;

		
		
		public DataUI () {
			super();
			initialize();
		}

		private void initialize() {
			curPanel = this;
			this.setVisible(true);
			this.setVisible(true);

			lbltitle = new JLabel("Manager window");
			lbltitle.setBounds(176, 27, 110, 25);

			this.setSize(400, 321);
			this.setLayout(null);
			
			this.add(lbltitle);
		
			btnBack = new JButton("Back");
			btnBack.setBounds(187, 253, 86, 25);
			this.add(btnBack,null);
			this.setVisible(true);
			/**
			 *  help button Implementation
			 */
			btnHelp = new JButton("Help");
			btnHelp.setBounds(390, 11, 80, 19);
			btnHelp.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					  HelpWin help = new HelpWin ("Click on one of the option");
					  System.out.println("user press Help button");
				}
			});
			this.add(btnHelp,null);
			
			JButton btnGlobalData = new JButton("Global Data");
			btnGlobalData.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					GData GData = new GData();
					setVisible(false);
					Global.main.setContentPane(GData);
					System.out.println("Entering Global Data mode");
					GData.btnBack.addActionListener(new ActionListener() {  
						public void actionPerformed(ActionEvent arg0) {
							Global.main.setContentPane(curPanel);
							curPanel.setVisible(true);
						}
					});
				}
			});
			btnGlobalData.setBounds(164, 159, 127, 25);
			add(btnGlobalData);
			
			JButton btnStatisticalData = new JButton("Statistical Data");
			btnStatisticalData.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					SData SData = new SData();
					setVisible(false);
					Global.main.setContentPane(SData);
					System.out.println("Entering Statistical Data mode");
					SData.btnBack.addActionListener(new ActionListener() { 
						public void actionPerformed(ActionEvent arg0) {
							Global.main.setContentPane(curPanel);
							curPanel.setVisible(true);
						}
					});
				}
				
			});
			btnStatisticalData.setBounds(164, 95, 127, 25);
			add(btnStatisticalData);
			this.setVisible(true);
			
		}
	}

